import { Tool } from '../../../Tool';
import VGE from '../../../VGE';
/**
 * 放大工具
 */
export class ZoomInTool extends Tool {
	constructor(viewer) {
		super(arguments);
		this.viewer = viewer;
		this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
	}

	start() {
		const _that = this;
		this.handler.setInputAction((e) => {
			const position = _that.viewer.scene.pickPosition(e.position);
			// zoom(this.viewer, 0.5, position)
			VGE.Viewer.camera.zoomIn(0.6, 1, position);
		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
	}

	cancel() {
		this.handler.destroy();
	}
}
ZoomInTool.toolId = 'ZoomInTool';
